package com.act.moudles.baseAct.controller;


import com.act.moudles.baseAct.entity.OnlineDeploy;
import com.act.moudles.baseAct.entity.TaskAno;
import com.act.moudles.baseAct.entity.TaskAnoPris;
import com.act.moudles.baseAct.service.TaskAnoService;
import com.act.utils.DataResult;
import com.act.utils.EmptyPage;
import com.act.utils.PageSearch;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("baseAct/taskAno")
@Api(tags = "流程节点")
public class TaskAnoController {

    @Resource
    private TaskAnoService taskAnoService;


    @PostMapping("page")
    @ApiOperation("分页查询")
    public DataResult pageTaskAno(@RequestBody PageSearch<TaskAno> pageSearch){
        if(pageSearch.getDomain().getDeployId() == null){
            return DataResult.success(false,"请选择一个流程");
        }
        Page<TaskAno> page = Page.of(pageSearch.getPageNum(),pageSearch.getPageSize());
        return DataResult.success("查询成功！",taskAnoService.pageTaskAno(page,pageSearch.getDomain()));
    }

    @PostMapping("saveSort")
    @ApiOperation("保存顺序")
    public DataResult saveSort(@RequestBody TaskAno taskAno){
        taskAnoService.updateById(taskAno);
        return DataResult.success("保存成功！");
    }








}
